<template>
    <a-button @click="todos.push('test')">add todos</a-button>
    <child-inject-test></child-inject-test>
</template>

<script lang="ts">
    import {computed, defineComponent} from 'vue'
    import ChildInjectTest from "@/views/test/provide_inject/components/ChildInjectTest.vue";

    export default defineComponent({
        components: { ChildInjectTest },
        provide() {
            return {
                todoLength: computed(() => this.todos.length)
            }
        },
        data() {
            return {
                todos: ['test', 'publish']
            }
        }
    })
</script>